<extend name="Base/mob_common"/>
<block name="mob_body">
    <div class="sold-container ">
        <div class="am-tabs" id="doc-my-tabs">
            <div class="am-tabs-bd"style="padding: 0px">

                <link rel="stylesheet" href="__CSS__/apps/store.css"/>
                <script src="__JS__/store.js"></script>
                <div class="sold-list-box"style="padding: 0px">
                    <ul class="sold-list">
                        <notempty name="sellOrder">
                            <volist name="sellOrder" id="vl">
                                <li class="sold-box">
                                    <div class="am-panel am-panel-default">
                                        <div class="am-panel-hd" style="padding:5px;">
                                            <div class="am-g">
                                                <div class="am-u-sm-6 am-text-left" style="padding: 0px;"><span>订单号：{$vl.id}</span>
                                                </div>
                                                <div class="am-u-sm-6 am-text-right" style="padding: 0px;"><span>买家：<a
                                                        href="{$vl.b_user.space_mob_url}">{$vl.b_user.nickname}</a></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="am-panel-bd"style="padding: 5px">
                                            <div class="sold am-g">
                                                <ul>
                                                    <li class="goods-avatar">
                                                        <img class="am-img-thumbnail am-radius"
                                                             src="{$vl.goods.cover_id|getThumbImageById=222,222}">
                                                    </li>
                                                    <li class="goods-info">
                                                        <h5 class="goods-name">{$vl.goods.title}</h5>

                                                        <p>原价：
                                                            {$vl.total_cny}</p>

                                                        <p>订单价格：
                                                            <php>$pay=$vl['total_cny']+$vl['adj_cny'];</php>
                                                            {$pay}
                                                        </p>

                                                        <p>共{$vl.total_count}件</p>
                                                        <if condition="$vl['condition'] eq -1">
                                                            <p>已取消</p>
                                                        </if>

                                                        <if condition="$vl['condition'] eq 0">
                                                            <form class="change-price"
                                                                  data-url="{:U('mob/store/adjPrice')}">
                                                                <input type="hidden" name="order_id" value="{$vl.id}">

                                                                <p>等待买家付款</p>
                                                                <span>价格调整</span>
                                                                <input type="text" name="adj_cny" value="{$vl.adj_cny}"style="padding: 5px;width: 20%">
                                                                <button type="button" class="am-btn am-btn-primary am-btn-xs sure-change">确认</button>
                                                            </form>
                                                        </if>

                                                        <if condition="$vl['condition'] eq 1">
                                                            <form data-url="{:U('mob/store/send')}" class="sure-send"
                                                                  method="post">
                                                                <input type="hidden" name="order_id" value="{$vl.id}">

                                                                <p>等待卖家发货</p>
                                                                <span>收货人：{$vl.r_name}</span>
                                                                <span>联系地址：{$vl.r_pos}</span>

                                                                <p>邮编：{$vl.r_code}</p>
                                                                <span>电话：{$vl.r_phone}</span><br>
                                                                <td>
                                                                    <span>快递名称：</span>
                                                                    <select name="trans_name" class="form-control">
                                                                        <optgroup label="常用">
                                                                            <option>顺丰速运</option>
                                                                            <option>圆通速递</option>
                                                                            <option>中通速递</option>
                                                                            <option>汇通速递</option>
                                                                            <option>韵达快递</option>
                                                                            <option>宅急送</option>
                                                                            <option>EMS</option>
                                                                        </optgroup>
                                                                        <optgroup label="其他">
                                                                            <option>其他物流</option>
                                                                            <option>无需物流</option>
                                                                        </optgroup>
                                                                    </select>
                                                                </td>
                                                                <span>快递单号：</span> <input type="text" name="trans_code">
                                                                <button type="button" class="sureSend">确认发货</button>
                                                            </form>
                                                        </if>
                                                        <if condition="$vl['condition'] eq 2">
                                                            <p>等待确认收货</p>
                                                            <span>快递名称：{$vl.trans_name}</span><br>
                                                            <span>单号：{$vl.trans_code}</span>
                                                            <span>发货时间：{$vl.trans_time|friendlyDate}</span>
                                                        </if>
                                                        <if condition="$vl['condition'] eq 3">
                                                            <if condition="$vl['response'] eq 0">
                                                                <p>【好评】+1</p>
                                                            </if>
                                                            <if condition="$vl['response'] eq 1">
                                                                <p>【中评】+0</p>
                                                            </if>
                                                            <if condition="$vl['response'] eq 2">
                                                                <p>【差评】-1</p>
                                                            </if>

                                                        </if>
                                                        <if condition="$vl['condition'] eq 5">
                                                            <p>超时取消</p>
                                                        </if>

                                                    </li>
                                                </ul>

                                            </div>
                                        </div>
                                    </div>
                                </li>
                            </volist>
                            <else/>
                            <div>
                                <span>
                                    你还没有出售任何商品，去<a href="{:U('mob/store/addgoods')}">发布宝贝</a>看看吧
                                </span>
                            </div>
                        </notempty>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <script>
        sure_send();
        change_price();
    </script>


</block>